<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript">
    
        var div = document.createElement('div');
        var p = document.createElement('p');
        document.body.appendChild(div);
        div.appendChild(p);
        p.innerText = "邓哥";
        div.setAttribute('class', 'example');
        p.setAttribute('class', 'slogan');
        
    
    
    </script>
</body>
</html>